package com.example.gift;

import androidx.appcompat.app.AppCompatActivity;

import android.media.MediaPlayer;
import android.os.Bundle;
import android.util.Log;
import android.view.KeyEvent;
import android.widget.Toast;

import Utils.Play;
import Utils.ToStart;

public class MainActivity extends AppCompatActivity {

//    private ToStart toStart;
//    private Play play;
//    private MediaPlayer mediaPlayer;

//    public MainActivity(){
//
//    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
//        toStart = new ToStart(MainActivity.this);
//        play = new Play(MainActivity.this);
    }

    @Override
    public void onBackPressed() {
//        Toast.makeText(this,"重写返回键",Toast.LENGTH_SHORT).show();
        Log.e("BackPress","back");
    }

    @Override
    public boolean onKeyDown(int keyCode, KeyEvent event) {
        Log.e("keydown","keydown");
        switch (keyCode){
            case KeyEvent.KEYCODE_VOLUME_DOWN:
            case KeyEvent.KEYCODE_VOLUME_UP:
//                toStart.changeSystemSound();
                break;
            default:
                break;
        }
        return false;
    }
}